﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Emmajn.ChildParentExtension.SilverlightClassLibrary
{
    /// <summary>
    /// Verifies conditions using true/false propositions.
    /// </summary>
    static class Assert
    {
        public static void IsValidRequiredString(string value, int maxLength)
        {
            if (value == null)
                throw new ArgumentNullException();
            else if (value == string.Empty)
                throw new ArgumentException();
            else if (value.Length > maxLength)
                throw new ArgumentOutOfRangeException();
        }

        public static void IsValidOptionalString(string value, int maxLength)
        {
            if (value == string.Empty)
                throw new ArgumentException();
            else if (value != null && value.Length > maxLength)
                throw new ArgumentOutOfRangeException();
        }
    }
}
